import request from "@/router/axios";
// const base_url = "http://10.200.1.71:9999";
const base_url = "http://10.59.1.203:9999";
export function findSiteOrderAdminPage(data) {
  //活动场地租赁订单列表
  return request({
    url: base_url + "/plm/admin/site/findSiteOrderAdminPage",
    method: "get",
    params: data
  });
}
export function findSiteOrderAdminDetail(data) {
  //活动场地订单详情
  return request({
    url: base_url + "/plm/admin/site/findSiteOrderAdminDetail",
    method: "get",
    params: data
  });
}
export function findDayLeaseSiteInfo(data) {
  //获取 活动场地租指定日期租赁情况
  return request({
    url: base_url + "/plm/site/findDayLeaseSiteInfo",
    method: "get",
    params: data
  });
}
export function findSiteRejectList(data) {
  //管理端 获取 活动场地 驳回原因
  return request({
    url: base_url + "/plm/admin/site/findSiteRejectList",
    method: "get",
    params: data
  });
}
export function sureSiteOrderPrice(obj) {
  //管理端 活动场地 定价
  return request({
    url: base_url +"/plm/admin/site/sureSiteOrderPrice",
    method: 'post',
    data: obj
  })
}
export function rejectSiteOrderPrice(obj) {
  //管理端 活动场地 驳回
  return request({
    url: base_url +"/plm/admin/site/rejectSiteOrderPrice",
    method: 'post',
    data: obj
  })
}
export function takeSiteOrderAdmin(obj) {
  //管理端 活动场地 接单
  return request({
    url: base_url +"/plm/admin/site/takeSiteOrderAdmin",
    method: 'post',
    data: obj
  })
}
export function findMeetOrderAdminPage(data) {
  //会议室租赁订单列表
  return request({
    url: base_url + "/plm/admin/meet/findMeetOrderAdminPage",
    method: "get",
    params: data
  });
}
export function findMeetOrderAdminDetail(data) {
  //会议室租赁订单详情
  return request({
    url: base_url + "/plm/admin/meet/findMeetOrderAdminDetail",
    method: "get",
    params: data
  });
}
export function takeMeetOrderAdmin(obj) {
  //会议室订单接单
  return request({
    url: base_url +"/plm/admin/meet/takeMeetOrderAdmin",
    method: 'post',
    data: obj
  })
}

// 公共导出文件
export function ExportFile(url, obj) {
  request({
    url:base_url + url,
    method: 'get',
    params: obj,
    responseType: 'blob'
  }).then(response => {
    if (!response) {
      return
    }
    let link = document.createElement('a')
    link.href = window.URL.createObjectURL(new Blob([response.data]))
    link.target = '_blank'
    let filename = response.headers['content-disposition']
    link.download = decodeURI(filename)
    document.body.appendChild(link)
    link.click()
    document.body.removeChild(link)
  })
}
// 文件导入
export function ImportFile(obj) {
  return request({
    url: base_url +"/ppc/admin/car/importSpaceCar",
    method: 'post',
    data: obj
  })
}
